package com.shanshan.system.controller;

import com.shanshan.system.util.UploadUtil;
import com.shanshan.system.vo.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * -*- coding:utf-8 -*-
 *
 * @author 太阳偷渡青山
 * @software IntelliJ IDEA
 * @date 2022/09/28 22:04
 * @Description
 */
@RestController
@RequestMapping("/upload")
public class UploadController {
    /**
     * 添加用户的头像上传远程
     *
     * @param file 文件
     * @return {@link Result}
     */
    @RequestMapping("/sure")
    public Result upload(MultipartFile file){
        String url = UploadUtil.uploadOOS(file);
        System.out.println(url);
        return new Result(200,"上传成功",url);
    }

}